<extend name="Public/base"/>

<block name="body">
	<div class="main-title">
		<h2>
			{$info['id']?'编辑':'新增'}导航
			<notempty name="pid">
				[&nbsp;父导航：<a href="{:U('index','pid='.$pid)}">{$parent.title}</a>&nbsp;]
			</notempty>
		</h2>
	</div>
	<form action="{:U()}" method="post" class="form-horizontal">
		<input type="hidden" name="pid" value="{$pid}">
		<div class="form-item">
			<label class="item-label">导航标题<span class="check-tips">（用于显示的文字）</span></label>
			<div class="controls">
				<input type="text" class="text input-large" name="title" value="{$info.title|default=''}">
			</div>
		</div>
		<div class="form-item">
			<label class="item-label">导航连接<span class="check-tips">（用于调转的URL，支持带http://的URL或U函数参数格式）</span></label>
			<div class="controls">
				<input type="text" class="text input-large" name="url" value="{$info.url|default=''}">
			</div>
		</div>
		<div class="form-item">
		 <link rel="stylesheet" type="text/css" href="__STATIC__/kindeditor/themes/default/default.css" media="all">
<script charset="utf-8" src="__STATIC__/kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="__STATIC__/kindeditor/zh_CN.js"></script>
	<script type="text/javascript">
	//图片上传
	KindEditor.ready(function(K) {
				var editor = K.editor({
					allowFileManager : true,
				          uploadJson : "{:U('File/kindupload',array('session_id'=>session_id(),'type'=>'picture','filepeth'=>MODULE_NAME))}",
				     fileManagerJson : '__STATIC__/kindeditor/php/file_manager_json.php',
				});
				//单图文上传
				K("#image1_iconpic").click(function() {
					editor.loadPlugin("image", function() {
						editor.plugin.imageDialog({
							clickFn : function(url, title, width, height, border, align) {
								K("#url1_iconpic").val(url);
								K("#one_pic_iconpic").attr('src',url);
								editor.hideDialog();
							}
						});
					});
				});
    });
</script>
			<label class="item-label">导航图标<span class="check-tips">（菜单图标,默认为空）</span></label>
			<div class="controls">
                 <a class="btn btn-mini" id="image1_iconpic">上传</a> <input name="iconurl" class="text input-8x" type="text" id="url1_iconpic" value="{$info.iconurl|default=''}" >
				<br>
				<div class="upload-pre-item"><br><img height="200" width="400" src="__ROOT__{$info.iconurl|default=''}" id="one_pic_iconpic"/></div>
			</div>
		</div>
        <div class="form-item">
            <label class="item-label">新窗口打开<span class="check-tips">（是否新窗口打开链接）</span></label>
            <div class="controls">
                <select name="target">
                     <option value="0">否</option>
					 <option value="1">是</option>
                </select>
            </div>
        </div>
		<div class="form-item">
			<label class="item-label">优先级<span class="check-tips">（导航显示顺序）</span></label>
			<div class="controls">
				<input type="text" class="text input-small" name="sort" value="{$info.sort|default='0'}">
			</div>
		</div>
		<div class="form-item">
			<input type="hidden" name="id" value="{$info.id|default=''}">
			<button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
			<button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
		</div>
	</form>
</block>
<block name="script">
<script type="text/javascript" charset="utf-8">
	//导航高亮
	highlight_subnav('{:U('index')}');
</script>
</block>
